package com.fishing.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fishing.entity.L_Email;
import com.fishing.mapper.L_EmailMapper;
import com.fishing.service.L_EmailService;

@Service
public class L_EmailServiceImpl implements L_EmailService{
	@Autowired
	private L_EmailMapper emailMapper;

	@Override
	public int deleteByPriamryKey(Long id) throws Exception {
		return this.emailMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(L_Email email) throws Exception {
		return this.emailMapper.insert(email);
	}

	@Override
	public List<?> selectAll(String  PageIndex,String PageCount,int ZoneId) throws Exception {
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("PageIndex", (Integer.parseInt((PageIndex)) - 1) * Integer.parseInt(PageCount));
		map.put("PageCount", Integer.parseInt(PageCount));
		map.put("ZoneId", ZoneId);
		return this.emailMapper.selectAll(map);
	}

	@Override
	public int selectCount(int ZoneId) {
		return this.emailMapper.selectCount(ZoneId);
	}

	
}
